# Contributor: Milan P. Stanić <mps@arvanta.net>
# Maintainer: Milan P. Stanić <mps@arvanta.net>
pkgname=m1n1
pkgver=1.4.11
_artwork_commitid=8f94d09964c00678ed01b24de9b75350735ec486
pkgrel=0
pkgdesc="bootloader and experimentation playground for Apple Silicon"
url="https://github.com/AsahiLinux/m1n1"
arch="aarch64"
license="MIT"
options="!check" # no tests
makedepends="llvm bash imagemagick dtc"
source="m1n1-$pkgver.tar.gz::https://github.com/AsahiLinux/m1n1/archive/refs/tags/v$pkgver.tar.gz
	artwork-$pkgver.tar.gz::https://github.com/AsahiLinux/artwork/archive/$_artwork_commitid.tar.gz"

prepare() {
	default_prepare
	rmdir artwork
	tar xf "$srcdir/"artwork-$pkgver.tar.gz
	mv artwork-$_artwork_commitid artwork
}

build() {
	make ARCH=
}

package() {
	mkdir -p "$pkgdir"/usr/share/m1n1
	install -p -Dm644 "$builddir"/build/m1n1.bin $pkgdir/usr/share/m1n1/
	install -p -Dm644 "$builddir"/build/m1n1.macho $pkgdir/usr/share/m1n1/
}

sha512sums="
38a7c7d3b11e8543a9f89afaca008ed711152f6d91f2ab20e6ce4023fa90cf1ba0b406bcf0ba033b500caaefcfe6aa35cbcdf9cbcbf976e642f7b1689187d8bb  m1n1-1.4.11.tar.gz
60b5215fcf3d6b64e21553ddb87d0fad0588ce16ee8ba76e676233a6c91ca97373a0258b7a352f4f7028d1887d7c5a996de6aac1989d6e595e9b18477a25d2fb  artwork-1.4.11.tar.gz
"
